package com.wang.spring;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class ControllerTest {
	
	@RequestMapping("/hello")
	public String hello(Model model){		
		model.addAttribute("greeting","Hello springMVC!");		
		return "helloWorld";		
	}

	@RequestMapping(value="/redirect", method=RequestMethod.GET)
	public String hello02(Model model){		
		model.addAttribute("greeting","Hello springMVC!");		
		return "redirect:/hello";	
	}
	
	
	
	
}
